<extend name="Layout:layout_dialog" />
<block name="body_main">
    <form action="{:AddonU('attr_edit_save')}" method="post" class="xsui-form">
        <fieldset>
            <div class="xsui-form-field">
                <label>属性标题：</label>
                <input type="text" name="title" placeholder="属性标题"  value="{$data.title}" required="required" data-check-url="{:AddonU('check_attr_title')}" />
                <span class="xsui-form-field-tip">(中文或英文,用于前台显示)</span>
            </div>
            <div class="xsui-form-field">
                <label>属性分组：</label>
                <input type="text" name="group_name" value="{$data.group_name}" placeholder="属性分组" required="required" />
                <span class="xsui-form-field-tip">(如：基本资料、联系方式)</span>
            </div>
            <div class="xsui-form-field">
                <label>帮助提示：</label>
                <input type="text" name="help_text" value="{$data.help_text}" placeholder="帮助提示" size="30" />
                <span class="xsui-form-field-tip">(如有填写,则界面上鼠标划过会显示帮助提示)</span>
            </div>
            <div class="xsui-form-field">
                <label>字段备注：</label>
                <input type="text" name="field_comment" value="{$data.field_comment}" placeholder="字段备注" size="30" />
                <span class="xsui-form-field-tip">(对字段的辅助描述,不会显示在界面上)</span>
            </div>
            <div class="xsui-form-field" style="display: none;">
                <div style="margin-bottom:5px;"><label>配置内容：</label>(多个可选值以英文分号隔开,如：是;否;不确定)</div>
                <textarea cols="45" rows="3" name="options_content" placeholder="内容格式：是;否;不确定">{$data.options_content}</textarea>
            </div>
            <div class="xsui-form-field">
                <label>默认值：</label>
                <input type="text" name="field_default" placeholder="默认值" data-value="{$data.field_default}"/>
            </div>
            <div class="xsui-form-field">
                <label>是否必填：</label>
                <input type="checkbox" name="is_required" value="Y" data-value="{$data.is_required}"/>
            </div>
            <div class="xsui-form-field">
                <label>是否列表显示：</label>
                <input type="checkbox" name="is_listable" value="Y" data-value="{$data.is_listable}"/>
            </div>
            <div class="xsui-form-field">
                <label>是否搜索：</label>
                <input type="checkbox" name="is_searchable" value="Y" data-value="{$data.is_searchable}"/>
            </div>
            <div class="xsui-form-field">
                <label>是否导入：</label>
                <input type="checkbox" name="is_importable" value="Y" data-value="{$data.is_importable}"/>
            </div>
            <div class="xsui-form-field">
                <label>是否导出：</label>
                <input type="checkbox" name="is_exportable" value="Y" data-value="{$data.is_exportable}"/>
            </div>
            <div class="xsui-form-field">
                <label>是否来电弹屏显示：</label>
                <input type="checkbox" name="is_popup" value="Y" data-value="{$data.is_popup}"/>
            </div>
            <div class="xsui-form-field">
                <label>状态：</label>
                <sohtml:radio name="status" items="1=显示;0=隐藏" value="{$data.status}" required="required" />
            </div>
        </fieldset>
        <button type="submit" class="ui-state-default"><i class="fa fa-save"></i>保存</button>
        <button type="reset" class="ui-state-default">重置</button>
        <input type="hidden" name="id" value="{$data.id}"/>
    </form>    
</block>
<block name="body_after">
    <script type="text/javascript">
        $(':checkbox').each(function(){
            var $chk=$(this);
            if($chk.val()==$chk.data('value')){
                $chk.prop('checked',true);
            }
        })
    </script>
</block>